package com.atguigu.service;

import com.atguigu.pojo.Cart;
import com.atguigu.pojo.Order;
import com.atguigu.pojo.OrderItem;
import com.atguigu.pojo.Page;

import java.util.List;

/**
 * @author YAO
 * @create 2021-05-13 10:11
 */
public interface OrderService {

    String createOrder(Cart cart,Integer userId);

    /**
     * 查询全部订单
     * @return
     */
    List<Order> showAllOrders();

    /**
     * 发货
     * true发货成功，false发货失败
     * @param orderId
     * @return
     */
    boolean sendOrder(String orderId);

    /**
     * 查询订单详情
     * @param orderId
     * @return
     */
    List<OrderItem> showOrderDetail(String orderId);

    /**
     * 查看我的订单
     * @param userId
     * @return
     */
    List<Order> showMyOrders(Integer userId);

    /**
     * 确认收货
     * @param orderId
     * @return
     */
    boolean receiveOrder(String orderId);


    public Page<Order> page(Integer pageNo, Integer pageSize);

    void deleteOrdersByUserId(Integer userId);

    void deleteOrderItemsByOrderId(String orderId);

    void deleteOrderByOrderId(String orderId);
}
